package org.ghub.pdf.properties;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
 
public class globalProps {
	
	private String readBaseDirectory;
	private String exportBaseDirectory;		
	private String tokensForEPSContratos;
	private String readBaseDocDirectory;
	private String tokensForEPSContratosDoc;
		
	public globalProps() {
	}

	public String getReadBaseDirectory() {
		return readBaseDirectory;
	}

	public void setReadBaseDirectory(String readBaseDirectory) {
		this.readBaseDirectory = readBaseDirectory;
	}

	public String getExportBaseDirectory() {
		return exportBaseDirectory;
	}

	public void setExportBaseDirectory(String exportBaseDirectory) {
		this.exportBaseDirectory = exportBaseDirectory;
	}	

	public String getTokensForEPSContratos() {
		return tokensForEPSContratos;
	}

	public void setTokensForEPSContratos(String tokensForEPSContratos) {
		this.tokensForEPSContratos = tokensForEPSContratos;
	}	

	public String getReadBaseDocDirectory() {
		return readBaseDocDirectory;
	}

	public void setReadBaseDocDirectory(String readBaseDocDirectory) {
		this.readBaseDocDirectory = readBaseDocDirectory;
	}	

	public String getTokensForEPSContratosDoc() {
		return tokensForEPSContratosDoc;
	}

	public void setTokensForEPSContratosDoc(String tokensForEPSContratosDoc) {
		this.tokensForEPSContratosDoc = tokensForEPSContratosDoc;
	}

	public void readAll() {
		Properties prop = new Properties();
		InputStream input = null;
		try {
			input = new FileInputStream("src/org/ghub/pdf/properties/config.properties");
			prop.load(input);
			this.setReadBaseDirectory(prop.getProperty("readBaseDirectory"));
			this.setExportBaseDirectory(prop.getProperty("exportBaseDirectory"));
			this.setTokensForEPSContratos(prop.getProperty("tokensForEPSContratos"));
			this.setReadBaseDocDirectory(prop.getProperty("readBaseDocDirectory"));
			this.setTokensForEPSContratosDoc(prop.getProperty("tokensForEPSContratosDoc"));
	 
		} catch (IOException ex) {
			ex.printStackTrace();
		} finally {
			if (input != null) {
				try {
					input.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	 
	  }
}